<template>
  <div class="">
    <!-- 轮播图 -->
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="(item, index) in bannerData" :key="index">
        <img :src="item.picUrl" alt="" />
      </van-swipe-item>
    </van-swipe>
    <!-- 人气推荐 -->
    <PersonList :personList="personList"></PersonList>
  </div>
</template>

<script>
import { getBanner, getPersonList } from "../network/request";
import PersonList from "../components/personList.vue";
export default {
  data() {
    return {
      bannerData: [],
      personList: [],
    };
  },
  mounted() {
    getBanner().then(({ data }) => {
      console.log(data.data);
      this.bannerData = data.data;
    });
    getPersonList().then(({ data }) => {
      console.log(data.data);
      this.personList = data.data.slice(9,13);
    });
  },
  methods: {},
  components: { PersonList },
};
</script>

<style lang="scss">
.my-swipe {
  width: 100%;
  height: 300px;
  van-swipe-item,
  img {
    width: 100%;
    height: 100%;
  }
}
</style>
